#!/bin/sh

# PROVIDE: ympd
# REQUIRE: DAEMON musicpd
# KEYWORD: shutdown

# Add the following line to /etc/rc.conf to enable ympd:
#
# ympd_enable="YES"

. /etc/rc.subr

name="ympd"
rcvar="${name}_enable"
command="/usr/local/bin/${name}"
pidfile="/var/run/${name}.pid"
start_cmd="ympd_start"

load_rc_config "${name}"
: ${ympd_enable:="NO"}

ympd_start()
{
	check_startmsgs && echo "Starting ${name}."
	/usr/sbin/daemon -f -p "${pidfile}" "${command}" "${rc_flags}"
}

run_rc_command "$1"
